// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
const db = uniCloud.database().collection('uni-id-address')

module.exports = {
	_before: function() { // 通用预处理器

	},
	async selectAction(id) {
		const res = await db.where({
			_id: id
		}).get()
		if (res.affectedDocs != 0) {
			return {
				code: 200,
				...res.data[0]
			}
		} else {
			return {
				code: 201,
			}
		}
	}
}